package com.opengw.configuration.publish;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.opengw.configuration.entity.Content;
import com.opengw.configuration.route.Route;

@Entity
@Table(name = "publish_xml")
public class XMLPublish extends BasePublish implements Serializable{
	
	private static final long serialVersionUID = 4291617163025745435L;
	private Route route;
	private boolean fromFile;
	private String originalURL;
	private Content content;
	
	public void setRoute(Route route) {
		this.route = route;
	}
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="route_ref")
	public Route getRoute() {
		return route;
	}
	public void setOriginalURL(String originalURL) {
		this.originalURL = originalURL;
	}
	@Column(name = "original_url")
	public String getOriginalURL() {
		return originalURL;
	}
	public void setContent(Content content) {
		this.content = content;
	}
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="content_ref")
	public Content getContent() {
		return content;
	}
	public void setFromFile(boolean fromFile) {
		this.fromFile = fromFile;
	}
	@Column(name = "from_file")
	public boolean isFromFile() {
		return fromFile;
	}
	
	
}
